package com.fzq.orderserver.message;

import org.springframework.amqp.rabbit.annotation.Exchange;
import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.QueueBinding;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
public class MqReceiver {

    @RabbitListener(bindings = @QueueBinding(
            value = @Queue("QueueText_001"),
            exchange = @Exchange("exchange")
    ))
    public void processMessage(String message) {
        System.out.print("==============" + message);
    }

    @RabbitListener(bindings = @QueueBinding(
            value = @Queue("Order_001"),
            key = "computer_001",
            exchange = @Exchange("Order_001")
    ))
    public void processComputerOrder(String message) {
        System.out.print("==============" + message);
    }
}
